import React from 'react';
import FormEnhance, {InputNumber, InputText} from "common/form";
import {SecurityRole} from "type/entity/SecurityRole";
import {fetchUpdateRole} from "storage/redux/async-action/roleAsyncAction";
import {formDataConverter} from "./index";

const RoleUpdateComponent = () => {

    return (
        <FormEnhance<SecurityRole>
            title={"更新角色信息"}
            backupText={"角色列表"}
            requestAction={fetchUpdateRole}
            formDataConverter={formDataConverter}
        >
            <InputText<SecurityRole> name={"authority"} label={"角色定义"} required/>
            <InputText<SecurityRole> name={"explain"} label={"角色描述"} required/>
            <InputText<SecurityRole> name={"icon"} label={"角色图标"} required/>
            <InputNumber<SecurityRole> name={"weight"} label={"角色权重"} required/>
        </FormEnhance>
    );
};

export default RoleUpdateComponent;